//package adapter;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.Map;
//
//import com.android.volley.VolleyError;
//import com.qzhy.female.R;
//
//import Constant.Constance;
//import activity.LoginActivity;
//import activity.MineActivity;
//import activity.PostDetailActivity;
//import activity.RepliesActivity;
//import android.annotation.SuppressLint;
//import android.content.Context;
//import android.content.Intent;
//import android.util.Log;
//import android.view.View;
//import android.view.View.OnClickListener;
//import android.view.ViewGroup;
//import android.widget.BaseAdapter;
//import android.widget.EditText;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.ListView;
//import android.widget.TextView;
//import android.widget.Toast;
//import model.Comment;
//import utils.HTTPUtils;
//import utils.SetUtils;
//import utils.UILUtils;
//import volley.VolleyListener;
//import widget.PasteEditText;
//
//public class detail_other_post extends BaseAdapter {
//
//	private Context context;
//	private ArrayList<Comment> mOtherComment;
//	private ViewHold viewHold;
//	private PostDetailActivity activity;
//	
//	private int pis;
//	private PasteEditText mEtInput;
//	private TextView mTvSend;
//	private String TypeReply;
//	private int articleId;
//	private int ParentCommentId;
//	private detail_other_post detail_other_post;
//
//	public detail_other_post(Context context) {
//		this.context = context;
//		
//	}
//	public detail_other_post(Context context,PostDetailActivity activity, ArrayList<Comment> mOtherComment) {
//		this.context = context;
//		this.activity = activity;
//		this.mOtherComment = mOtherComment;
//	}
//	public detail_other_post(Context context, PostDetailActivity postDetailActivity,
//			ArrayList<Comment> mOtherComment, PasteEditText mEtInput, TextView mTvSend) {
//				this.context = context;
//				this.activity = postDetailActivity;
//				this.mOtherComment = mOtherComment;
//				this.mEtInput = mEtInput;
//				this.mTvSend = mTvSend;
//				
//	}
//	@Override
//	public int getCount() {
//		// TODO Auto-generated method stub
//		return mOtherComment.size();
//	}
//
//	@Override
//	public Object getItem(int position) {
//		// TODO Auto-generated method stub
//		return null;
//	}
//
//	@Override
//	public long getItemId(int position) {
//		return 0;
//	}
//
//	@Override
//	public View getView(final int position, View convertView, ViewGroup parent) {
//		final int pos=position;
//		if(convertView==null){
//			convertView=View.inflate(context, R.layout.item_detail_other_post, null);
//			viewHold = new ViewHold();
//			viewHold.list_each_other_post=(ListView) convertView.findViewById(R.id.list_each_other_post);
//			viewHold.ImgPhoto=(ImageView) convertView.findViewById(R.id.img_photo);
//			viewHold.TvName=(TextView) convertView.findViewById(R.id.tv_name);
//			viewHold.TvName1=(TextView) convertView.findViewById(R.id.tv_name1);
//			viewHold.TvTime=(TextView) convertView.findViewById(R.id.tv_time);
//			viewHold.TvTime1=(TextView) convertView.findViewById(R.id.tv_time1);
//			viewHold.TvList=(TextView) convertView.findViewById(R.id.tv_list);
//			viewHold.TvComment=(TextView) convertView.findViewById(R.id.tv_comment);
//			viewHold.TvComment1=(TextView) convertView.findViewById(R.id.tv_comment1);
//			viewHold.TvReply=(TextView) convertView.findViewById(R.id.tv_reply);
//			viewHold.LlChild=(LinearLayout) convertView.findViewById(R.id.ll_child);
//			convertView.setTag(viewHold);
//		}else {
//			viewHold = (ViewHold) convertView.getTag();
//		}	
//		    if(mOtherComment.size()>0){
//		    	viewHold.TvName.setText(mOtherComment.get(position).getUser().getNickname());
//		    	viewHold.TvComment.setText(mOtherComment.get(position).getContent());
//		    	if(mOtherComment.get(position).getUser().getProfileImg().startsWith("http")){
//		    		UILUtils.displayImageNoAnim(mOtherComment.get(position).getUser().getProfileImg(), viewHold.ImgPhoto);
//		    	}else {
//		    		UILUtils.displayImageNoAnim(Constance.URL.IMG_BASE+mOtherComment.get(position).getUser().getProfileImg(), viewHold.ImgPhoto);
//				}
//		    	viewHold.TvTime.setText(mOtherComment.get(position).getCreatedAt());
//		    	viewHold.TvList.setText(""+(position+1)+"楼");
//		    	if(mOtherComment.get(position).getParentCommentId()!=0){
//					viewHold.LlChild.setVisibility(View.VISIBLE);
//				}else {
//					viewHold.LlChild.setVisibility(View.GONE);
//				}
//		    	for (int i = 0; i < mOtherComment.size(); i++) {
//					if(mOtherComment.get(i).getId().equals(mOtherComment.get(position).getParentCommentId())){
//						viewHold.TvComment1.setText(mOtherComment.get(i).getContent());
//						viewHold.TvName1.setText(mOtherComment.get(i).getUser().getNickname());
//						viewHold.TvTime1.setText(mOtherComment.get(i).getCreatedAt());
//					}
//				}
//		    	viewHold.TvReply.setOnClickListener(new OnClickListener() {
//					private boolean IsReply;
//					@Override
//					public void onClick(View v) {
////						if(SetUtils.islogined(context)){
////							Intent intent = new Intent(context, RepliesActivity.class);
////							intent.putExtra(Constance.INTENT.REPLIES, 1);
//							ParentCommentId= mOtherComment.get(pos).getId();
////							intent.putExtra(Constance.INTENT.ARTICLE_PARENT_ID, parentCommentId);
//							articleId = mOtherComment.get(pos).getArticleId();
////							intent.putExtra(Constance.INTENT.ARTICLE_ID, articleId);
////							Log.i("回复文章IDparentCommentId", ""+parentCommentId);
////							Log.i("回复文章IDarticleId", ""+articleId);
////							activity.startActivityForResult(intent, 4564);
////						}else {
////							context.startActivity(new Intent(context,LoginActivity.class));
////						}
//						TypeReply="回复"+(position+1)+"楼"+mOtherComment.get(position).getUser().getNickname();
//						mEtInput.setHint(TypeReply);
//						ReplyOther();
//					}
//				});
//		    	viewHold.ImgPhoto.setOnClickListener(new OnClickListener() {
//					@Override
//					public void onClick(View v) {
//						if(SetUtils.islogined(context)){
//							Intent intent = new Intent(context,MineActivity.class);
//							intent.putExtra(Constance.INTENT.USER_ID, mOtherComment.get(position).getUser().getId());
//							context.startActivity(intent);
//						}else {
//							context.startActivity(new Intent(context,LoginActivity.class));
//						}
//					}
//				});
//		    }
//		return convertView;
//	}
//	class ViewHold{
//		ListView list_each_other_post;
//		ImageView ImgPhoto;
//		TextView TvName;
//		TextView TvName1;
//		TextView TvTime;
//		TextView TvTime1;
//		TextView TvList;
//		TextView TvComment;
//		TextView TvComment1;
//		TextView TvReply;
//		LinearLayout LlChild;
//	}	
//	private void ReplyOther() {
//		mTvSend.setOnClickListener(new OnClickListener() {
//			@Override
//			public void onClick(View v) {
//				if(mEtInput.getHint().equals(TypeReply)){
//					ReplyOthers();
//					Toast.makeText(context, TypeReply, 1).show();
//				}else {
//					Toast.makeText(context, "回复楼主", 1).show();
//				}
//			}
//		});
//	}
//	/**
//
//	 * 回复其他人
//
//	 */
//	private void ReplyOthers() {
//		activity.showLoadingDialog();
//		Map<String, String> params=new HashMap<String,String>();
//		params.put("user_id",""+SetUtils.GetUserId(context));
//		params.put("article_id",""+articleId);
//		params.put("parent_comment_id", ""+ParentCommentId);
//		params.put("content", mEtInput.getText().toString().trim());
//		HTTPUtils.post(context, Constance.URL.REPLY_POST, params, new VolleyListener() {
//			@Override
//			public void onResponse(String arg0) {
//				Toast.makeText(context, "onResponse"+arg0.toString(), 1).show();
//				if(arg0!=null){
//					activity.dismissLoadingDialog();
//					Toast.makeText(context, "回复成功",1).show();
//				}
//			}
//			@Override
//			public void onErrorResponse(VolleyError arg0) {
//				Toast.makeText(context, "解析错误",1).show();
//			}
//		});
//	}
//}
